<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="earn"  method="post">
    填写二类卡号<input type="text" id="cardnum" name="cardnum">
    购买份额<input type="number" id="e_num" name="e_num">
<input type="submit"  id="earn2" value="确认购买">
</form>
</body>

<script>
     $("#earn2").click(function () {
         $.get("earn",{"e_num":e_num},function (date){
             let  f = alert("goumaichengg");
         },"text")
     })
</script>
</html>